<?php
$a = 1;
$b = 2;

function Sum() {
	global $a, $b;
	
	$b = $a + $b;
}

Sum ();
echo $b;
?> 
<?php
$a = 2;
$b = 3;

function Sum2() {
	$GLOBALS ["b"] = $GLOBALS ["a"] + $GLOBALS ["b"];
}

Sum2 ();
echo $b;
?> 